class Weather extends React.component {
    constructor(props) {
        super(props)
        this.state = { isHot: true }
    }
    render() {
        const state = this.state;
        return `<h1 onClick={demo}>今天天气很{isHot ? '炎热' : '凉爽'}</h1>`
    }
}
ReactDOM.render(<Weather/>,document.getElementById('test'))

function demo() {
    console.log('被点击了哦！');
}